package com.app.mymvp.business.login;

import com.app.mymvp.base.BaseModel;
import com.app.mymvp.base.BasePresenter;
import com.app.mymvp.base.BaseView;
import com.app.mymvp.entity.UserInfoEntity;

/**
 * Created by HJ on 2016-10-10.
 */

public interface LoginContract {
    interface Model extends BaseModel {
        void login(String username, String password, LoginListener listener);
    }

    interface View extends BaseView {
        String getUserName();
        String getPassword();
        void toMainActivity(UserInfoEntity userInfoEntity);
        void clearUserName();
        void clearPassword();
        void showLoading();
        void hideLoading();
        void showFailedError();
    }
    abstract class Presenter extends BasePresenter<View, Model> {
        abstract void login();
        abstract void clear();
    }

    interface LoginListener {
        void success(UserInfoEntity userInfoEntity);
        void fail();
    }
}
